package com.ticket.sass.admin.controller;

import com.ticket.sass.admin.business.TicketOrderBusiness;
import com.ticket.sass.admin.business.impl.TicketOrderBusinessImpl;
import com.ticket.sass.admin.dto.input.order.TakeTicketOrderInput;
import com.ticket.sass.admin.dto.output.order.OrderDataModel;
import com.ticket.sass.admin.dto.output.order.TakeTicketOrderOutPut;
import com.ticket.sass.admin.model.ResultModel;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

/**
 * @author ywb
 * @date 2022-03-29 11:04
 */
@RestController
@Api(tags = {"取票订单管理"})
@RequestMapping("/take-ticket-orders")
public class TicketOrderController {
    final TicketOrderBusiness business;
    
    public TicketOrderController(TicketOrderBusinessImpl business) {
        this.business = business;
    }
    
    @GetMapping
    @ApiOperation("列表")
    public ResultModel<OrderDataModel<TakeTicketOrderOutPut>> list(
        @Valid TakeTicketOrderInput input
    ) {
        return ResultModel.success(
            business.list(input)
        );
    }

}
